﻿@using Microsoft.AspNet.Identity
@if (Request.IsAuthenticated)
{
    using (Html.BeginForm("Logout", "User", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" }))
    {
        @Html.AntiForgeryToken()

        <ul class="nav navbar-nav navbar-right nav-header">
            <li>
                @Html.ActionLink("你好 " + User.Identity.GetUserName() + " !", "Index", "Home", routeValues: new { Area = "Admin" }, htmlAttributes: new { title = "管理" })
            </li>
            <li><a href="javascript:document.getElementById('logoutForm').submit()">注销</a></li>
            <li class="checkout"><a href="/ShoppingCart"><span id="cart_icon" class="hidden-xs hidden-sm ng-binding">0</span></a></li>
        </ul>
    }
}
else
{
    <ul class="nav navbar-nav navbar-right nav-header">
        <li class="login">
                <a id="registerLink" href="/Admin/User/Login?returnUrl=@Request.RawUrl">
                    <img id="user" src="/Images/user.png" onmouseover="mouseOver(this,'user')" onmouseout="mouseOut(this,'user')">登录
                </a>
                <a href="/Admin/User/Register?returnUrl=%2F">/注册</a>
        </li>
    </ul>
}
